import request from '@/utils/request'

// 创建拼团商品
export function createGroupGoods(data) {
  return request({
    url: '/qd/group-goods/create',
    method: 'post',
    data: data
  })
}

// 更新拼团商品
export function updateGroupGoods(data) {
  return request({
    url: '/qd/group-goods/update',
    method: 'put',
    data: data
  })
}

// 删除拼团商品
export function deleteGroupGoods(id) {
  return request({
    url: '/qd/group-goods/delete?id=' + id,
    method: 'delete'
  })
}

// 获得拼团商品
export function getGroupGoods(id) {
  return request({
    url: '/qd/group-goods/get?id=' + id,
    method: 'get'
  })
}

// 获得拼团商品分页
export function getGroupGoodsPage(query) {
  return request({
    url: '/qd/group-goods/page',
    method: 'get',
    params: query
  })
}

//获取抽奖测试用户列表
export function getLotteryUser() {
  return request({
    url: '/qd/lottery/getLotteryUser',
    method: 'get'
  })
}

// 导出拼团商品 Excel
export function exportGroupGoodsExcel(query) {
  return request({
    url: '/qd/group-goods/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
